﻿<UserControl x:Class="OneStop.UI.MainControl"
    xmlns:my="clr-namespace:System.Windows.Controls;assembly=PresentationFramework" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:igWindows="http://infragistics.com/Windows"
    xmlns:igDP="http://infragistics.com/DataPresenter"
    xmlns:igRibbon="http://infragistics.com/Ribbon"
    xmlns:igThemes="http://infragistics.com/Themes"
    xmlns:igCA="http://infragistics.com/Chart"
    xmlns:igEditors="http://infragistics.com/Editors"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:mvPlan_Gases="clr-namespace:MVPlan.Engine.Gases;assembly=MVPlan.Engine"
    xmlns:mvPlan_Segment="clr-namespace:MVPlan.Engine.Segment;assembly=MVPlan.Engine"
    xmlns:local="clr-namespace:OneStop.UI" 
    Background="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}">
    <Grid Name="Root">
        <Grid.Resources>
            <local:VisibilityConverter x:Key="VisibilityConverter" />
            <local:ButtonVisibilityConverter x:Key="ButtonVisibilityConverter" />
            <local:WarningListConverter x:Key="WarningListConverter" />
            <Style TargetType="{x:Type igDP:LabelPresenter}" x:Key="LabelHidden">
                <Setter Property="Visibility" Value="Collapsed" />
            </Style>
            <Style TargetType="{x:Type igCA:Animation}" x:Key="LineAnimation">
                <Setter Property="BeginTime" Value="00:00:0" />
                <Setter Property="Duration" Value="00:00:0.75" />
            </Style>
            <Style x:Key="ImageButton" TargetType="Button">
                <Setter Property="Width" Value="16"/>
                <Setter Property="Height" Value="16"/>
                <Setter Property="OverridesDefaultStyle" Value="True"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Border Name="border" CornerRadius="3">
                                <Grid>
                                    <ContentPresenter>
                                        <ContentPresenter.RenderTransform>
                                            <TranslateTransform X="1.0" Y="1.0" />
                                        </ContentPresenter.RenderTransform>
                                    </ContentPresenter>
                                    <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Name="content"/>
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsPressed" Value="True">
                                    <Setter TargetName="content" Property="RenderTransform" >
                                        <Setter.Value>
                                            <TranslateTransform Y="1.0" />
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="DeleteImage" TargetType="Image">
                <Setter Property="Width" Value="16"/>
                <Setter Property="Height" Value="16"/>
                <Setter Property="Source">
                    <Setter.Value>
                        <BitmapImage UriSource="Images\Ribbon16\delete.png"/>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="Image.IsMouseOver" Value="true">
                        <Setter Property="Image.Source">
                            <Setter.Value>
                                <BitmapImage UriSource="Images\Ribbon16\delete_hot.png"/>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Grid.Resources>
        
        <DockPanel>
            
            <DockPanel DockPanel.Dock="Left" Width="440">

                <Border Padding="5">
                    <DockPanel>
                        <StackPanel HorizontalAlignment="Stretch">
                            <DockPanel>
                                <!-- Inputs -->
                                <GroupBox DockPanel.Dock="Top" Header="Enter Dive Waypoints" 
                                          Name="groupBox2" VerticalAlignment="Top" Padding="5">
                                    <StackPanel>
                                        <igDP:XamDataGrid BindToSampleData="True" EditModeEnding="Inputs_EditModeEnding"
                                                  RecordUpdated="Inputs_RecordUpdated"
                                                  BorderBrush="Crimson" BorderThickness="0" GroupByAreaLocation="None" Name="Inputs" Padding="0" Theme="Office2k7Black" 
                                                Height="140" VerticalContentAlignment="Top" VerticalAlignment="Top">
                                                <igDP:XamDataGrid.Resources>
                                                    <Style x:Key="ButtonCell" TargetType="{x:Type igDP:CellValuePresenter}">
                                                        <Setter Property="Control.Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                                                    <Button Style="{StaticResource ImageButton}" Visibility="{Binding Path=DataItem, Converter={StaticResource ButtonVisibilityConverter}}" 
                                                                            Click="InputsDelete_Click">
                                                                        <StackPanel Margin="0">
                                                                            <Image Style="{StaticResource DeleteImage}" />
                                                                        </StackPanel>
                                                                    </Button>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                    <Style x:Key="EmptyCell" TargetType="{x:Type igEditors:ValueEditor}" >
                                                        <Setter Property="Visibility" Value="Hidden" />
                                                    </Style>
                                                </igDP:XamDataGrid.Resources>
                                                <igDP:XamDataGrid.FieldLayoutSettings>
                                                    <igDP:FieldLayoutSettings  AddNewRecordLocation="OnBottom" AllowAddNew="True" AllowDelete="True" AutoGenerateFields="False" />
                                                </igDP:XamDataGrid.FieldLayoutSettings>
                                                <igDP:XamDataGrid.FieldLayouts>
                                                    <igDP:FieldLayout>
                                                        <igDP:FieldLayout.FieldSettings>
                                                            <igDP:FieldSettings AllowEdit="True" CellClickAction="EnterEditModeIfAllowed" />
                                                        </igDP:FieldLayout.FieldSettings>
                                                        <igDP:FieldLayout.Fields>
                                                            <igDP:UnboundField>
                                                                <igDP:Field.Settings>
                                                                    <igDP:FieldSettings LabelPresenterStyle="{StaticResource LabelHidden}" 
                                                                            LabelMaxWidth="20" CellMaxWidth="20" 
                                                                            
                                                                            CellValuePresenterStyle="{StaticResource ButtonCell}" />
                                                                </igDP:Field.Settings>
                                                            </igDP:UnboundField>
                                                            <igDP:Field Label="Depth" Name="Depth">
                                                                <igDP:Field.Settings>
                                                                    <igDP:FieldSettings CellMaxWidth="45" EditAsType="{x:Type sys:Int32}" EditorType="{x:Type igEditors:XamNumericEditor}" LabelMaxWidth="45" />
                                                                </igDP:Field.Settings>
                                                            </igDP:Field>
                                                            <igDP:Field Label="Time" Name="Time">
                                                                <igDP:Field.Settings>
                                                                    <igDP:FieldSettings CellMaxWidth="40" EditAsType="{x:Type sys:Int32}" EditorType="{x:Type igEditors:XamNumericEditor}" LabelMaxWidth="40" />
                                                                </igDP:Field.Settings>
                                                            </igDP:Field>
                                                            <igDP:Field DataType="{x:Type mvPlan_Gases:Gas}" Label="Gas" Name="Gas">
                                                                <igDP:Field.Settings>
                                                                    <igDP:FieldSettings CellMaxWidth="110" EditAsType="{x:Type mvPlan_Gases:Gas}" EditorType="{x:Type igEditors:XamComboEditor}" LabelMaxWidth="110">
                                                                        <igDP:FieldSettings.EditorStyle>
                                                                            <Style TargetType="{x:Type igEditors:XamComboEditor}">
                                                                                <Setter Property="igEditors:XamComboEditor.ItemsProvider" Value="{DynamicResource ComboEditorList}" />
                                                                            </Style>
                                                                        </igDP:FieldSettings.EditorStyle>
                                                                    </igDP:FieldSettings>
                                                                </igDP:Field.Settings>
                                                            </igDP:Field>
                                                            <igDP:Field Label="Setpoint" Name="Setpoint">
                                                                <igDP:Field.Settings>
                                                                    <igDP:FieldSettings CellMaxWidth="55" LabelMaxWidth="55" />
                                                                </igDP:Field.Settings>
                                                            </igDP:Field>
                                                        </igDP:FieldLayout.Fields>
                                                    </igDP:FieldLayout>
                                                </igDP:XamDataGrid.FieldLayouts>
                                            </igDP:XamDataGrid>
                                        <CheckBox Height="16" Margin="5,5,0,0" Name="chkOCDeco" VerticalAlignment="Top">Auto-Pick Open Circuit Deco Gas</CheckBox>
                                    </StackPanel>
                                </GroupBox>
                            </DockPanel>
                            <DockPanel>
                                <!-- Dive Information -->
                                <GroupBox Header="Dive Information" Name="DiveInfo" VerticalAlignment="Top" Padding="5">
                                    <Grid Name="DiveInfoGrid" VerticalAlignment="Top" Height="170">
                                        <Grid.Resources>
                                            <Style x:Key="DiveInfo" TargetType="{x:Type Label}">
                                                <Setter Property="FontWeight" Value="Bold" />
                                                <Setter Property="FontSize" Value="16" />
                                            </Style>
                                        </Grid.Resources>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="190" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="29" />
                                            <RowDefinition  />
                                        </Grid.RowDefinitions>

                                        <StackPanel Grid.Column="0" Grid.Row="0" Grid.RowSpan="2">
                                            <Grid Name="DiveInfoDetails">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="110" />
                                                    <ColumnDefinition Width="80" />
                                                </Grid.ColumnDefinitions>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                    <RowDefinition />
                                                </Grid.RowDefinitions>
                                                <Label Grid.Column="0" Grid.Row="0" Name="label1" Style="{StaticResource DiveInfo}">Run Time:</Label>
                                                <Label Grid.Column="1" Grid.Row="0" Name="lblRuntime" Style="{StaticResource DiveInfo}">60 min</Label>

                                                <Label Grid.Column="0" Grid.Row="1" Name="label2" Style="{StaticResource DiveInfo}">Deco Time:</Label>
                                                <Label Grid.Column="1" Grid.Row="1" Name="lblDecotime" Style="{StaticResource DiveInfo}">60 min</Label>

                                                <Label Grid.Column="0" Grid.Row="2" Name="label7" Style="{StaticResource DiveInfo}">Bailout Diff:</Label>
                                                <Label Grid.Column="1" Grid.Row="2" Name="lblBailDiff" Style="{StaticResource DiveInfo}">200 min</Label>

                                                <Label Grid.Column="0" Grid.Row="3" Name="label3" Style="{StaticResource DiveInfo}">OTUs:</Label>
                                                <Label Grid.Column="1" Grid.Row="3" Name="lblOTUs" Style="{StaticResource DiveInfo}">290</Label>

                                                <Label Grid.Column="0" Grid.Row="4" Name="label4" Style="{StaticResource DiveInfo}">CNS:</Label>
                                                <Label Grid.Column="1" Grid.Row="4" Name="lblCNS" Style="{StaticResource DiveInfo}">56%</Label>

                                                <Label Grid.Column="0" Grid.Row="5" Name="label5" Style="{StaticResource DiveInfo}">GF:</Label>
                                                <Label Grid.Column="1" Grid.Row="5" Name="lblGF" Style="{StaticResource DiveInfo}">15-85</Label>

                                            </Grid>
                                        </StackPanel>

                                        <Label Height="30" Grid.Column="1" Grid.Row="0" Name="lblGasUsage" Style="{StaticResource DiveInfo}" VerticalAlignment="Top">Dive Gas Usage:</Label>
                                        <ScrollViewer Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
                                            <StackPanel Name="GasStack" />
                                        </ScrollViewer>
                                    </Grid>
                                </GroupBox>
                            </DockPanel>
                            <DockPanel>
                                <!-- Gases -->
                                <GroupBox Header="Gas Configuration" Name="groupBox4" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Padding="5">
                                    <igDP:XamDataGrid x:Name="Gases" GroupByAreaLocation="None" 
                                  RecordUpdated="Gases_RecordUpdated" BindToSampleData="True" BorderThickness="0" Theme="Office2k7Black" >
                                        <igDP:XamDataGrid.Resources>
                                            <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="buttonCell">
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                                            <Button Visibility="{Binding Path=DataItem, Converter={StaticResource ButtonVisibilityConverter}}" 
                                            Click="GasesDelete_Click" Style="{StaticResource ImageButton}">
                                                                <StackPanel Margin="0,0,0,0">
                                                                    <Image Style="{StaticResource DeleteImage}" />
                                                                </StackPanel>
                                                            </Button>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </igDP:XamDataGrid.Resources>
                                        <igDP:XamDataGrid.FieldLayoutSettings>
                                            <igDP:FieldLayoutSettings AllowAddNew="True" AutoGenerateFields="False" AllowDelete="True" AddNewRecordLocation="OnBottom" />
                                        </igDP:XamDataGrid.FieldLayoutSettings>
                                        <igDP:XamDataGrid.FieldLayouts>
                                            <igDP:FieldLayout>
                                                <igDP:FieldLayout.FieldSettings>
                                                    <igDP:FieldSettings CellClickAction="EnterEditModeIfAllowed" AllowEdit="true" />
                                                </igDP:FieldLayout.FieldSettings>
                                                <igDP:FieldLayout.Fields>
                                                    <igDP:UnboundField>
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings LabelPresenterStyle="{StaticResource LabelHidden}" LabelMaxWidth="20" CellMaxWidth="20" CellValuePresenterStyle="{StaticResource buttonCell}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:UnboundField>
                                                    <igDP:Field Name="PercentO2" Label="%O2">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings LabelMaxWidth="40" CellMaxWidth="40" EditAsType="{x:Type sys:Int32}" EditorType="{x:Type igEditors:XamNumericEditor}" />
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="PercentHe" Label="%He">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings LabelMaxWidth="40" CellMaxWidth="40" EditAsType="{x:Type sys:Int32}" EditorType="{x:Type igEditors:XamNumericEditor}" />
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="PercentN2" Label="%N2">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings LabelMaxWidth="40" CellMaxWidth="40" />
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="MOD" Label="MOD">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings LabelMaxWidth="40" CellMaxWidth="40" EditAsType="{x:Type sys:Int32}" EditorType="{x:Type igEditors:XamNumericEditor}" />
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="Ceiling" Label="Ceiling">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings LabelMaxWidth="45" CellMaxWidth="45" EditAsType="{x:Type sys:Int32}" EditorType="{x:Type igEditors:XamNumericEditor}" />
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="END" Label="END">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings LabelMaxWidth="35" CellMaxWidth="35" EditAsType="{x:Type sys:Int32}" EditorType="{x:Type igEditors:XamNumericEditor}" />
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="Enable" Label="Enable">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings LabelMaxWidth="50" CellMaxWidth="50" />
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                </igDP:FieldLayout.Fields>
                                            </igDP:FieldLayout>
                                        </igDP:XamDataGrid.FieldLayouts>
                                    </igDP:XamDataGrid>
                                </GroupBox>
                            </DockPanel>
                        </StackPanel>
                    </DockPanel>
                </Border>

            </DockPanel>                
            
            <Border Padding="5">
                <GroupBox Header="Output Dive Profile" Name="grpOutput" Padding="5">
                <DockPanel>

                    <igDP:XamDataGrid DockPanel.Dock="Top" Height="370" Focusable="True" BorderThickness="0" GroupByAreaLocation="None" 
                                      Name="Outputs" Theme="Office2k7Black">
                        <igDP:XamDataGrid.Resources>
                            <Style TargetType="{x:Type igDP:RecordSelector}" x:Key="RecordSelectorHidden">
                                <Setter Property="Visibility" Value="Collapsed" />
                            </Style>
                        </igDP:XamDataGrid.Resources>
                        <igDP:XamDataGrid.FieldLayoutSettings>
                            <igDP:FieldLayoutSettings RecordSelectorLocation="None" AllowAddNew="False" AllowDelete="False" AutoGenerateFields="False" HighlightAlternateRecords="True" />
                        </igDP:XamDataGrid.FieldLayoutSettings>
                        <igDP:XamDataGrid.FieldLayouts>
                            <igDP:FieldLayout>
                                <igDP:FieldLayout.FieldSettings>
                                    <igDP:FieldSettings AllowEdit="False" CellClickAction="SelectRecord" />
                                </igDP:FieldLayout.FieldSettings>
                                <igDP:FieldLayout.Fields>
                                    <igDP:Field Name="TypeString">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="20" LabelMaxWidth="20" LabelPresenterStyle="{StaticResource LabelHidden}">
                                                <igDP:FieldSettings.CellValuePresenterStyle>
                                                    <Style TargetType="{x:Type igDP:CellValuePresenter}">
                                                        <Setter Property="Control.Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                                                    <Grid Margin="0">
                                                                        <Image Height="16" HorizontalAlignment="Center" Margin="0" Source="Images/Ribbon16/warning.png" 
                                                                       Stretch="Fill" StretchDirection="Both" VerticalAlignment="Center" 
                                                                       ToolTip="{Binding Path=DataItem.Warnings, Converter={StaticResource WarningListConverter}}" 
                                                                       Visibility="{Binding Path=DataItem.Warnings, Converter={StaticResource VisibilityConverter}}" 
                                                                       Width="16" />
                                                                    </Grid>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                </igDP:FieldSettings.CellValuePresenterStyle>
                                            </igDP:FieldSettings>
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="Segment" Name="TypeName">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="75" LabelMaxWidth="75" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="Depth" Name="Depth" >
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="45" EditAsType="{x:Type sys:Int32}" LabelMaxWidth="45" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="Time" Name="TimeString">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="60" LabelMaxWidth="60">
                                                <igDP:FieldSettings.CellValuePresenterStyle>
                                                    <Style TargetType="{x:Type igDP:CellValuePresenter}">
                                                        <Setter Property="HorizontalAlignment" Value="Right" />
                                                    </Style>
                                                </igDP:FieldSettings.CellValuePresenterStyle>
                                            </igDP:FieldSettings>
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="Run Time" Name="RunTime">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="60" EditAsType="{x:Type sys:Int32}" LabelMaxWidth="60" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="Gas" Name="Gas">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="75" LabelMaxWidth="75" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="Mode" Name="Mode">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="40" LabelMaxWidth="40" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="PPO2" Name="PPO2">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="40" LabelMaxWidth="40" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="PPN2" Name="PPN2">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="40" LabelMaxWidth="40" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="Flush" Name="Flush">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="40" LabelMaxWidth="40" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                    <igDP:Field Label="END" Name="END">
                                        <igDP:Field.Settings>
                                            <igDP:FieldSettings CellMaxWidth="35" EditAsType="{x:Type sys:Int32}" LabelMaxWidth="35" />
                                        </igDP:Field.Settings>
                                    </igDP:Field>
                                </igDP:FieldLayout.Fields>
                            </igDP:FieldLayout>
                        </igDP:XamDataGrid.FieldLayouts>
                    </igDP:XamDataGrid>

                    <!-- Chart -->
                    <igCA:XamChart Theme="LucidDream" DockPanel.Dock="Bottom" x:Name="ProfileChart" BorderBrush="Crimson" BorderThickness="0">
                        <igCA:XamChart.Template>
                            <ControlTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="15" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>

                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="15" />
                                    </Grid.RowDefinitions>

                                    <ContentPresenter Name="PART_Default_Chart" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" />

                                    <TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" TextAlignment="Center">
                                    <TextBlock.LayoutTransform>
                                        <RotateTransform Angle="90" />
                                    </TextBlock.LayoutTransform>
                                    Depth 
                                </TextBlock>

                                    <TextBlock Grid.Row="1" Grid.ColumnSpan="2" TextAlignment="Center">Time (min)</TextBlock>
                                </Grid>

                            </ControlTemplate>
                        </igCA:XamChart.Template>

                        <!-- Legend -->
                        <igCA:XamChart.Legend>
                            <igCA:Legend Padding="0"  Margin="20,0,20,0" />
                        </igCA:XamChart.Legend>
                        <!-- Scene -->
                        <igCA:XamChart.Scene>
                            <igCA:Scene Margin="0,0,0,0" MarginType="Percent">
                                <igCA:Scene.GridArea>
                                    <igCA:GridArea Margin="5,3,5,10" MarginType="Percent"/>
                                </igCA:Scene.GridArea>
                            </igCA:Scene>
                        </igCA:XamChart.Scene>

                        <!-- Data points -->
                        <igCA:XamChart.Series />
                        
                        <!-- Axes -->
                        <igCA:XamChart.Axes>
                            <igCA:Axis AxisType="PrimaryX" AutoRange="true" />
                            <igCA:Axis AxisType="PrimaryY" AutoRange="true">
                                <igCA:Axis.Label>
                                    <igCA:Label Format="{}{0:;0;0}" />
                                </igCA:Axis.Label>
                                <igCA:Axis.Stripes>
                                    <igCA:Stripe />
                                </igCA:Axis.Stripes>
                            </igCA:Axis>
                        </igCA:XamChart.Axes>
                    </igCA:XamChart>
                </DockPanel>
            </GroupBox>
            </Border>

            
        </DockPanel>        
        
    </Grid>
    
</UserControl>
